package com.qfjy.homework.huangshijun;

/**
 * @author:hsj date:2022/6/29 19:50
 * @version:1.0
 * 代理对象，外层
 */
public class ProxyImage implements Image{

    private RealImage realImage;
    private String fileName;

    public ProxyImage(String fileName){
        this.fileName = fileName;
    }

    @Override
    public void dsiplay() {
//        调用中间层，
        if(realImage == null){
            realImage = new RealImage(fileName);
        }
        realImage.dsiplay();
    }
}
